Skip to content

feat(plugin-activity-guard): add activity entry guards - #728

Merged
ENvironmentSet merged 8 commits into
mainfrom
feature/fep-2521
Jul 21, 2026
Merged

feat(plugin-activity-guard): add activity entry guards#728
ENvironmentSet merged 8 commits into
mainfrom
feature/fep-2521

Conversation

@ENvironmentSet

@ENvironmentSet ENvironmentSet commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Add a plugin allowing programmers to restrict activity entrances via predicates called 'guards'.

@changeset-bot

changeset-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: efd2711

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stackflow/plugin-activity-guard Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: afd388bf-63ca-4f4c-9b67-cf28d1bde275

📥 Commits

Reviewing files that changed from the base of the PR and between 0072c62 and efd2711.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (9)
  • .changeset/bright-guards-enter.md
  • .pnp.cjs
  • extensions/plugin-activity-guard/esbuild.config.js
  • extensions/plugin-activity-guard/package.json
  • extensions/plugin-activity-guard/src/ActivityGuard.ts
  • extensions/plugin-activity-guard/src/NonEmptyArray.ts
  • extensions/plugin-activity-guard/src/activityGuardPlugin.ts
  • extensions/plugin-activity-guard/src/index.ts
  • extensions/plugin-activity-guard/tsconfig.json

Disabled knowledge base sources:

  • Jira integration is disabled
  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Introduced the Activity Guard plugin for controlling activity entry.
    • Added predicate-based guards that can allow, block, or redirect navigation.
    • Added guard composition utilities, including support for sequential guard evaluation.
    • Guards apply to both initial activity loading and runtime push or replace actions.
    • Added the new package for public distribution with TypeScript support.

Walkthrough

Adds @stackflow/plugin-activity-guard, including typed guard utilities, redirect-chain resolution, Stackflow event interception, package build configuration, exports, workspace registration, and a major-release changeset.

Changes

Activity guard plugin

Layer / File(s) Summary
Package and build setup
extensions/plugin-activity-guard/package.json, extensions/plugin-activity-guard/tsconfig.json, extensions/plugin-activity-guard/esbuild.config.js, .pnp.cjs, .changeset/bright-guards-enter.md
Defines the package metadata, TypeScript configuration, CJS/ESM builds, workspace mappings, and major release changeset.
Typed guard resolution
extensions/plugin-activity-guard/src/ActivityGuard.ts, extensions/plugin-activity-guard/src/NonEmptyArray.ts
Adds typed allow and redirect results, guard composition, activity targets, guard maps, and recursive redirect resolution.
Stackflow plugin integration
extensions/plugin-activity-guard/src/activityGuardPlugin.ts, extensions/plugin-activity-guard/src/index.ts
Rewrites guarded initial events and runtime push/replace actions, and re-exports the plugin API.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant StackflowRuntime
  participant activityGuardPlugin
  participant resolveGuards
  StackflowRuntime->>activityGuardPlugin: invoke navigation hook
  activityGuardPlugin->>resolveGuards: resolve activity target
  resolveGuards-->>activityGuardPlugin: return target and blocked status
  activityGuardPlugin-->>StackflowRuntime: continue with resolved action
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fep-2521

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Jul 13, 2026

Copy link
Copy Markdown
  • @stackflow/demo

    yarn add https://pkg.pr.new/daangn/stackflow/@stackflow/plugin-activity-guard@728.tgz
    

commit: c0d9718

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 13, 2026

Copy link
Copy Markdown

Deploying stackflow-demo with  Cloudflare Pages  Cloudflare Pages

Latest commit: efd2711
Status:⚡️  Build in progress...

View logs

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 13, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
stackflow-docs efd2711 Commit Preview URL Jul 21 2026, 09:01 AM

ENvironmentSet and others added 4 commits July 16, 2026 14:51
Add typed entry policies that can allow an Activity or replace its target
with a guarded redirect while preserving push, replace, and initial-entry
semantics. Include ordered combinators, package documentation, executable
contract coverage, and release metadata.

Co-authored-by: Codex <noreply@openai.com>
@ENvironmentSet
ENvironmentSet marked this pull request as ready for review July 21, 2026 08:58
@ENvironmentSet
ENvironmentSet enabled auto-merge (squash) July 21, 2026 08:58
@ENvironmentSet
ENvironmentSet merged commit d915c5f into main Jul 21, 2026
5 of 8 checks passed
@ENvironmentSet
ENvironmentSet deleted the feature/fep-2521 branch July 21, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant